﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace DiscoveryLogic.DataViz.NetworkDiagram.NetworkData
{
    /// <summary>
    /// whether the node can be filtered, evaluated, constrained
    /// it works on node member primitive data and ignore node type
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class Filterable : Attribute
    {
        private bool _CanFilter;
        /// <summary></summary>
        public bool CanFilter
        {
            get
            {
                return this._CanFilter;
            }
            set
            {
                this._CanFilter = value;
            }
        }

        private SqlDbType _DataType;
        /// <summary></summary>
        public SqlDbType DataType
        {
            get
            {
                return this._DataType;
            }
            set
            {
                this._DataType = value;
            }
        }

        private bool _IsCollection;
        /// <summary></summary>
        public bool IsCollection
        {
            get
            {
                return this._IsCollection;
            }
            set
            {
                this._IsCollection = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="canFilter"></param>
        /// <param name="dataType"></param>
        public Filterable(bool canFilter, SqlDbType dataType)
        {
            this._CanFilter = canFilter;
            this._DataType = dataType;
            this._IsCollection = false;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="canFilter"></param>
        /// <param name="dataType"></param>
        /// <param name="isCollection"></param>
        public Filterable(bool canFilter, SqlDbType dataType, bool isCollection)
        {
            this._CanFilter = canFilter;
            this._DataType = dataType;
            this._IsCollection = isCollection;
        }
    }
}
